<?php
/*-----------------------------------------------------------------------------------*/
# Register main Scripts and Styles
/*-----------------------------------------------------------------------------------*/
add_action( 'init', 'jquery_register_google_cdn' );
function jquery_register_google_cdn() {
  if ( !is_admin() ) {
    wp_deregister_script( 'jquery' );
    // register from google and for footer
    wp_register_script( 'jquery', ( 'http://code.jquery.com/jquery-latest.min.js' ), false, null );
    wp_enqueue_script( 'jquery' );
  }
}

add_action( 'wp_enqueue_scripts', 'zon_register' ); 
function zon_register() {
	## Register All Styles
	wp_enqueue_style( 'style-chosen', get_template_directory_uri() . '/assets/css/chosen.css' );
	wp_enqueue_style( 'style-fancybox', get_template_directory_uri() . '/assets/css/jquery.fancybox.css' );
	wp_enqueue_style( 'style-slider', get_template_directory_uri() . '/assets/css/flexslider.css' );
	wp_enqueue_style( 'style-slider-header', get_template_directory_uri() . '/assets/css/style-slider-header.css' );
	wp_enqueue_style( 'style-owl', get_template_directory_uri() . '/assets/css/owl.carousel.css' );
	wp_enqueue_style( 'style-owl-theme', get_template_directory_uri() . '/assets/css/owl.theme.css' );
	//Slider Price Ranger
	wp_enqueue_style( 'style-jquery-ui', get_template_directory_uri() . '/assets/css/ui-lightness/jquery-ui-1.10.4.custom.css' );
	//End
	
	## Register All Scripts
    wp_register_script( 'zon-maps', 'http://maps.googleapis.com/maps/api/js?v=3&amp;sensor=true', array( 'jquery' ) ); 
    wp_register_script( 'zon-gmap3', get_template_directory_uri() . '/assets/js/gmap3.min.js', array( 'jquery' ) );  
    wp_register_script( 'zon-map-infobox', get_template_directory_uri() . '/assets/js/gmap3.infobox.min.js', array( 'jquery' ) );  
    
    wp_register_script( 'zon-scripts', get_template_directory_uri() . '/assets/js/common.js', array( 'jquery' ) );
    wp_register_script( 'zon-jquery', get_template_directory_uri() . '/assets/js/jquery.js', array( 'jquery' ) );
    wp_register_script( 'zon-cookie', get_template_directory_uri() . '/assets/js/cookie.js', array( 'jquery' ) );
    wp_register_script( 'zon-car', get_template_directory_uri() . '/assets/js/jquery.film_roll.js', array( 'jquery' ) );
    wp_register_script( 'zon-slider-full', get_template_directory_uri() . '/assets/js/jquery.cslider.js', array( 'jquery' ) );
    wp_register_script( 'zon-modernizr', get_template_directory_uri() . '/assets/js/modernizr.custom.28468.js', array( 'jquery' ) );
    wp_register_script( 'zon-owl', get_template_directory_uri() . '/assets/js/owl.carousel.js', array( 'jquery' ) );
	
	//Slider Price Ranger
	wp_register_script( 'zon-jquery-ui', get_template_directory_uri() . '/assets/js/jquery-ui-1.10.4.custom.min.js', array( 'jquery' ) );
	//End
	//jquery fancybox
    wp_register_script( 'zon-fancybox', get_template_directory_uri() . '/assets/js/jquery.fancybox.pack.js', array( 'jquery' ) );
    
    //jquery slider single property.
    wp_register_script( 'zon-slider', get_template_directory_uri() . '/assets/js/jquery.flexslider.js', array( 'jquery' ) );
	
	## Get Map Script
	//if( zon_get_option('map_home')){
		wp_enqueue_script( 'zon-maps' );
		wp_enqueue_script( 'zon-gmap3' );
		wp_enqueue_script( 'zon-map-infobox' );
	//}

	## Get Global Style
	wp_enqueue_script( 'style-chosen' );
	wp_enqueue_script( 'style-fancybox' );
	wp_enqueue_script( 'style-slider' );
	wp_enqueue_script( 'style-slider-header' );
	wp_enqueue_script( 'style-owl' );
	wp_enqueue_script( 'style-jquery-ui' );
	
	## Get Global Scripts
    wp_enqueue_script( 'zon-scripts' );
    wp_enqueue_script( 'zon-fancybox' );
    wp_enqueue_script( 'zon-slider' );
    wp_enqueue_script( 'zon-jquery' );
    wp_enqueue_script( 'zon-cookie' );
    wp_enqueue_script( 'zon-car' );
    wp_enqueue_script( 'zon-modernizr' );
    wp_enqueue_script( 'zon-slider-full' );
    wp_enqueue_script( 'zon-owl' );
    wp_enqueue_script( 'zon-jquery-ui' );
}
?>